﻿#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);



}

Widget::~Widget()
{
    delete ui;
    senserConnect.stop();
}

void Widget::on_connectBtn_clicked()
{
    on_serverName_editingFinished();
//    senserConnect.start();
}

void Widget::on_serverName_editingFinished()
{
    QString serverName = ui->serverName->text();
    QString serverAddress = ui->serverAddress->text();
    int serverPort = ui->serverPort->value();
    senserConnect.setConnectParam(serverName,serverAddress,serverPort);
}

void Widget::on_serverAddress_editingFinished()
{
    on_serverName_editingFinished();
}

void Widget::on_serverPort_editingFinished()
{
    on_serverName_editingFinished();
}

void Widget::on_disConnectBtn_clicked()
{
    senserConnect.disConnect();
}
